%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% This file is part of the book
%%
%% Algorithmic Graph Theory
%% http://code.google.com/p/graph-theory-algorithms-book/
%%
%% Copyright (C) 2009--2011 Minh Van Nguyen <nguyenminh2@gmail.com>
%%
%% See the file COPYING for copying conditions.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\DontPrintSemicolon
\SetAlgoNoLine
%%
%% input
\KwIn{A binomial heap $H$.}
%%
%% output
\KwOut{The minimum vertex of $H$ removed.}
\BlankLine
%%
%% algorithm body
$v \assign$ extract minimum vertex from root list of $H$\;
$H_2 \assign$ empty binomial heap\;
$L \assign$ list of $v$'s children reversed\;
$\headElem[H_2] \assign L[0]$\;
$H \assign$ merge $H$ and $H_2$ as per Algorithm~\ref{alg:tree_data_structures:merge_binomial_heaps}\;
\Return $v$\;
